package com.easybuy.service.impl;

import com.easybuy.bean.EasybuyProductCategory;
import com.easybuy.mapper.EasybuyProductCategoryMapper;
import com.easybuy.service.IProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductCategoryServiceImpl implements IProductCategoryService {
    @Autowired
    private EasybuyProductCategoryMapper easybuyProductCategoryMapper;
    @Override
    public List<EasybuyProductCategory> listByPage(int page, int pageSize){
        int from=(page -1)*pageSize;
        return easybuyProductCategoryMapper.listByPage(from,pageSize);
    }
    // int deleteByPk(int epId);
    public int deleteByPk(int id){
        return easybuyProductCategoryMapper.deleteByPk(id);
    }
    //int save(EasybuyProduct ebProduct);
    public int save(EasybuyProductCategory ebProductCategory){
        return easybuyProductCategoryMapper.save(ebProductCategory);
    }

    public List<EasybuyProductCategory> all(){
        return easybuyProductCategoryMapper.all();
    }

    public EasybuyProductCategory findByPk(Integer id){
        return easybuyProductCategoryMapper.findByPk(id);
    }
    public int updateByPk(EasybuyProductCategory ebProductCategory){
        return easybuyProductCategoryMapper.updateByPk(ebProductCategory);
    }
    public EasybuyProductCategory findByName(String name){
        return easybuyProductCategoryMapper.findByName(name);
    }
    public List<EasybuyProductCategory> findByPId(Integer id){
        return easybuyProductCategoryMapper.findByPId(id);
    }
    //�鸸��
    public List<EasybuyProductCategory> fP(){
        return easybuyProductCategoryMapper.fP();
    }
    //������
    public List<EasybuyProductCategory> fS(){
        return easybuyProductCategoryMapper.fS();
    }

    public int countAll(){
        return easybuyProductCategoryMapper.countAll();
    }
    public  int deleteByepid(int Id){
        return easybuyProductCategoryMapper.deleteByepid(Id);
    }
}
